/*This header represents entities of the project*/
/*include enums and structures*/
#ifndef ENTITIES_H_
#define ENTITIES_H_

#include "definitions.h"

/*enum of instructions*/
typedef enum{
	Comment,
	Empty,
	Label,
	InstructionString,
	InstructionData,
	InstructionEntry,
	InstructionExtern,
	Command,
	Unknown
}ArgumentType;

/*boolean enum*/
typedef enum {
	false,
	true
}boolean;

/*addressing method enum*/
typedef enum{
	Immediate, 	/*0*/
	Direct,		/*1*/
	Indexed,	/*2*/
	Register	/*3*/
}AddressingMethod;

/*assemble pass number enum*/
typedef enum{
	First,
	Second
}PassNumber;

/*commands struct*/
typedef struct _cmds{
	char name[COMMAND_L];		/*command name*/
	int index;					/*command index*/
	boolean(*cmdHandler)();		/*pointer to method of the command*/
}CommandsList;

/*labels struct*/
typedef struct _labelsList{
	char name[LABEL_L];			/*label name*/
	int decimalAddress;			/*label decimal address*/
	int value;					/*label value if .string or .data*/
	char *type;					/*label type code or data*/
	int codeSize;				/*code size of label*/
}LabelsList;

/*external labels struct*/
typedef struct _externLabelsList{
	char name[LABEL_L];		/*label name*/
	int decimalAddress;		/*label decimal address*/
}ExternLabelsList;

/*enteries labels struct*/
typedef struct _enterLabelsList{
	char name[LABEL_L];		/*label name*/
	int decimalAddress;		/*labels decimal address*/
}EntriesLabelsList;


/*objects struct*/
typedef struct _objectsList{
	int decimalAddress;			/*object decimal address*/
	long machineCode;			/*object machine code*/
	char type[OBJECT_TYPE_L];	/*object type A,E,R*/
}ObjectsList;

/*registers struct*/
typedef struct _registersList{
	int index;					/*register index*/
	char name[REGISTER_L];		/*register name*/
}RegistersList;

/*operand type enum*/
typedef enum {
	Source,
	Destination
}OperandType;

#endif /* ENTITIES_H_ */
